<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="/public/css/index.css">
    <link rel="stylesheet" type="text/css" href="/public/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/public/css/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="/public/css/bootstrap-table.min.css">
    <script src="/public/js/jquery.min.js"></script>
    <script src="/public/js/bootstrap.min.js"></script>
    <script src="/public/js/bootstrap-table.min.js"></script>
    <script src="/public/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="/public/js/index.js"></script>
</head>
<body>
<!--顶部导航-->
<div class="container-fluid">
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="/">博客首页</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    {% for category in categorys %}
                    <li><a href="#">{{category.name}}</a></li>
                    {% endfor %}
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {% if userInfo.username %}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{userInfo.username}} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a id="logout" href="javascript:;">退出</a></li>
                        </ul>
                    </li>
                    {% else %}
                        <span class="navbar">
                            <a data-toggle="modal" data-target="#myModal">登录</a>/<a data-toggle="modal" data-target="#myModal2">注册</a>
                        </span>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>
</div>
<!--登录框模态-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">欢迎登录</h4>
            </div>
            <div class="modal-body">
                <div id="login">
                    <p class="container-fluid"><span>用户名:</span><input type="text" name="username"></p>
                    <p class="container-fluid"><span>密&nbsp;&nbsp;&nbsp;码:</span><input type="password" name="userpassword"></p>
                    <p class="container-fluid" id="login_info"></p>
                    <!--<input id="login_btn" type="button" value="登录">-->
                    <!--<input id="login_zhuce" type="button" value="注册">-->
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button id="login_btn" type="button" class="btn btn-primary">登录</button>
            </div>
        </div>
    </div>
</div>
<!--注册框模态-->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">欢迎注册</h4>
            </div>
            <div class="modal-body">
                <div id="register">
                    <p><span>用户名:</span><input type="text" name="username"></p>
                    <p><span>密码:</span><input type="password" name="userpassword"></p>
                    <p><span>确认密码:</span><input type="password" name="reuserpassword"></p>
                    <p id="register_info"></p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button id="registerBtn" type="button" class="btn btn-primary">确认注册</button>
            </div>
        </div>
    </div>
</div>
{% block main %} {%endblock%}
</body>
</html>